import groovy.time.TimeCategory

// def date = new Date(0)
def date = new Date()

println date.format('yyyy-MM-dd')

use TimeCategory, {
	Date newDate = date + 1.year - 1.month
	println newDate.format('yyyy-MM-dd')
}

def list = [1, 2, 3, 4]

// Collections.rotate(list, 1)
// assert [4, 1, 2, 3] == list

// 用 use 可以这样
use Collections, {
	list.rotate 1
	assert [4, 1, 2, 3] == list
}


